<template>
  <div>
    <el-carousel trigger="click" height="340px" arrow="never" class="bannerStyle" >
      <el-carousel-item v-for="(item,i) in banerList" :key="i">
        <img :src="item" style="width:100%;height:100%;" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  data() {
    return {
      banerList: []
    };
  },
  methods: {
    getData() {
      let getBannerList = [
        "https://n1-q.mafengwo.net/s13/M00/03/30/wKgEaVyu94SAIqDcAAheevdYPB4887.png",
        "https://p1-q.mafengwo.net/s11/M00/AB/01/wKgBEFrrsvOACErGAAGJ4YrPQUs78.jpeg",
        "https://p1-q.mafengwo.net/s11/M00/4A/E0/wKgBEFrQBqeAYyjMAAURcw8MxG470.jpeg",
        "https://b1-q.mafengwo.net/s12/M00/D4/09/wKgED1vpIAiAI6D9AAZ72-z4yZw188.png",
        "https://n1-q.mafengwo.net/s10/M00/6F/B3/wKgBZ1h4nkiAURQzAAHf0nrnc6I29.jpeg"
      ];

      this.banerList = getBannerList;
    }
  },
  mounted() {
    this.getData();
  }
};
</script>

<style lang="stylus" scoped>
.bannerStyle {
  width: 700px;

  >>> .el-carousel__indicators {
    display: flex;
    align-items: center;
    align-items: center;
    right: 20px;
    left: inherit;
    transform: translateX(0);

    .el-carousel__indicator {
      padding: 3px;
      margin: 0 4px 28px 4px;
    }

    .el-carousel__button {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      opacity: 1;
    }
  }

  >>> .is-active {
    .el-carousel__button {
      background-color: orange;
      position: relative;

      &:before {
        content: '';
        width: 17px;
        height: 17px;
        position: absolute;
        border: 2px solid #ffa500;
        border-radius: 50%;
        top: -5.5px;
        left: -5.5px;
      }
    }
  }
}
</style>